#include "node_rootnode.h"
#include "node_rendertarget.h"
#include "g_graphics.h" // for graphics2D declaration 
#include "xge.h"

namespace xge{
namespace graphics{


  window::GraphicsWindow* RootNode::GetGraphicsWindow() const {
    return XGameEngine::GetGraphics2D()->GetGraphicsWindow();
  }

  RootNode::RootNode()  {}


  void RootNode::OnPaint( const Timer::tick_t& diff_time ) {
    static TexturePtr kNullTexturePtr;
    // Start rendering here 
    BeginScene(Graphics2D::MODE_NORMAL,Graphics2D::PRIMITIVE_QUAD,NULL,kNullTexturePtr,BLEND_DEFAULT);
    XGameEngine::GetGraphics2D()->Clear( color_ );
    ListBaseNode::OnPaint(diff_time);
    EndScene();
  }


}// namespace graphics
}// namespace xge